use crate::dto;
use serde::{Deserialize, Serialize};
use validator::Validate;
use wanmesh_common::validator::validate_string_is_not_empty;

pub type AddRequest = dto::core::candidate_path::AddParams;

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct UpdateRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub candidate_path_id: String,
    pub params: dto::core::candidate_path::UpdateParams,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct GetRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub candidate_path_id: String,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct DeleteRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub candidate_path_id: String,
}

pub type ListRequest = wanmesh_common::dto::ListRequest<dto::core::candidate_path::Filter>;
pub type ListResponseData =
    wanmesh_common::dto::ListResponseData<dto::core::candidate_path::CandidatePathItem>;
pub type ListInfoResponseData =
    wanmesh_common::dto::ListResponseData<dto::candidate_path::CandidatePathInfo>;
